import axios from "./axios";

interface DataType {
    userName:string,
    password:string
}

export interface ListType<T> {
    avatar:string,
    nickName:string,
    password:string,
    userId:string,
    userName:string,
    userSignature:string
}

export interface DataListType<T> {
    code: string;
    data: ListType<T>;
    msg: string;
}

export interface ResultType {
    avatar:string,
    nickName:string,
    password:string,
    userId:string,
    userName:string,
    userSignature:string
}

export const register = (data:DataType): Promise<DataListType<ResultType>> => {
    return axios.post('/user/register',data);
}